#print set([1,7,2,4,2,7])
'''a = [1,7,2,4,2,7]
print a
a.sort()
print a'''

import numpy as np
import string

def normalization(lsInput):
    # type of lsInput should be ndarray
    iLen = lsInput.shape
    print iLen
    fMax = np.amax(lsInput, axis=0)
    fMin = np.amin(lsInput, axis=0)
    fRange = fMax - fMin
    print fMax, fMin, fRange
    
    i = 0       #Row
    lsInput = lsInput.astype(float)
    lsOut = lsInput
    
    while i<iLen[1]:
        j = 0       #Line
        while j<iLen[0]:
            lsOut[j,i] = (lsInput[j,i] - fMin[i])/fRange[i]
            j = j + 1
        i = i + 1
        
    return lsOut

a = np.array([[100,20],[40,50],[70,80],[40,202],[50,20]])
#b = array([[10,20],[4,5],[7,8],[4,20],[5,2]])
#c = a - b
c = normalization(a)
print "===================="
#print c

abc = np.array([10,200,30,40,50,60,70,80,90,40,10])

print abc
abcd = np.unique(abc)
#abcd = np.array(abcd)
abcd = np.sort(abcd)
print abcd

#print a, type(a)
'''print "================"
b = amax(a, axis=0)
#b = a[:,0]
#c=b.sort(0,'quicksort')
#print c
print b
#a =array([10,20,30,40,50,60,70,80,90])
#b = array([[15,15,15]])
#a.append(10000)
c=15
d=12
e=14
try:
    #np.append(a,b)
    a = append(a,[[c],[d],[e]],axis=1)
    print "bingo"
except:
    print "error"
    
print a

afd = [10,20,30,40,50,60,70,80,90]


print len(afd)'''



